<!-- 2017-12-7 14:56:03 | 修改 木遥（微信:  http://marsgis.cn/weixin.html ） -->
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="x5-fullscreen" content="true" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <!-- 标题及搜索关键字 -->
    <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
    <meta
      name="description"
      content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型  gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包  地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
    />

    <link rel="shortcut icon" type="image/x-icon" href="http://mars3d.cn/favicon.ico" />
    <title>路线漫游及控制 卫星示例 | Mars3D | 三维地图 | 火星科技 | 合肥火星科技有限公司</title>

    <script
      type="text/javascript"
      src="../lib/include-lib.js"
      libpath="../lib/"
      include="jquery,font-awesome,bootstrap,bootstrap-checkbox,jquery.range,layer,haoutil,turf,mars3d"
    ></script>

    <link href="css/style.css" rel="stylesheet" />
  </head>

  <body class="dark">
    <!--加载前进行操作提示，优化用户体验-->
    <div id="mask" class="signmask" onclick="removeMask()"></div>

    <div id="mars3dContainer" class="mars3d-container"></div>

    <script src="./js/common.js"></script>
    <script type="text/javascript">
      'use script' //开发环境建议开启严格模式

      var map

      function initMap(options) {
        //合并属性参数，可覆盖config.json中的对应配置
        var mapOptions = mars3d.Util.merge(options, {
          scene: {
            //此处参数会覆盖config.json中的对应配置
            center: {
              y: 31.728412,
              x: 117.150456,
              z: 7850.52,
              heading: 29.1,
              pitch: -30.1,
              roll: 0.1,
            },
          },
          control: {
            animation: true, //是否创建动画小器件，左下角仪表
            timeline: true, //是否显示时间线控件
          },
        })

        //创建三维地球场景
        map = new mars3d.Map('mars3dContainer', mapOptions)

        map.clock.multiplier = 1

        //创建矢量数据图层
        var graphicLayer = new mars3d.layer.GraphicLayer()
        map.addLayer(graphicLayer)

        // 绑定点击事件
        graphicLayer.on(mars3d.EventType.click, (event, position) => {
          console.log('单击了漫游路线', event)
        })

        var arrLine = [
          {
            id: '1',
            name: 'A01',
            speed: 100,
            positions: [
              [117.298794, 31.882442, 500],
              [117.249731, 31.88091, 600],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/zhanji.glb',
              scale: 0.01,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'cylinder',
                color: '#ff0000',
              },
            ],
          },
          {
            id: '2',
            name: 'A02',
            speed: 100,
            positions: [
              [117.244308, 31.876828, 900],
              [117.246598, 31.815902, 900],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/MQ-9-Predator.glb',
              scale: 1,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'wall',
              },
            ],
          },
          {
            id: '3',
            name: 'A03',
            speed: 100,
            positions: [
              [117.160928, 31.82166, 400],
              [117.18824, 31.811822, 400],
              [117.227675, 31.790077, 400],
              [117.279938, 31.797397, 400],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/zhanji.glb',
              scale: 0.01,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'cylinder',
              },
            ],
          },
          {
            id: '4',
            name: 'A04',
            speed: 100,
            positions: [
              [117.24595, 31.843448, 800],
              [117.184863, 31.841885, 800],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/MQ-9-Predator.glb',
              scale: 1,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'wall',
                color: '#a8009d',
              },
            ],
          },
          {
            id: '5',
            name: 'A05',
            speed: 100,
            positions: [
              [117.281458, 31.873736, 1000],
              [117.280849, 31.679814, 1000],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/zhanji.glb',
              scale: 0.01,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'cylinder',
                color: '#ffff00',
              },
            ],
          },
          {
            id: '6',
            name: 'A06',
            speed: 100,
            positions: [
              [117.259156, 31.831094, 600],
              [117.22723, 31.791011, 700],
              [117.190839, 31.751602, 1000],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/MQ-9-Predator.glb',
              scale: 1,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'wall',
                color: '#ffff00',
              },
            ],
          },
          {
            id: '7',
            name: 'A07',
            speed: 100,
            positions: [
              [117.224735, 31.868128, 500],
              [117.226971, 31.810324, 500],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/zhanji.glb',
              scale: 0.01,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'cylinder',
                color: '#0047d4',
              },
            ],
          },
          {
            id: '8',
            name: 'A08',
            speed: 100,
            positions: [
              [117.169828, 31.83365, 900],
              [117.189117, 31.83417, 900],
              [117.211684, 31.83573, 900],
              [117.232588, 31.833755, 900],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/MQ-9-Predator.glb',
              scale: 1,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'wall',
                color: '#d9d900',
              },
            ],
          },
          {
            id: '9',
            name: 'A09',
            positions: [
              [117.189192, 31.856163, 100],
              [117.188899, 31.818951, 100],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/zhanji.glb',
              scale: 0.01,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'cylinder',
                color: '#00b0cf',
              },
            ],
          },
          {
            id: '10',
            name: 'A10',
            speed: 200,
            positions: [
              [117.163332, 31.853159, 1000],
              [117.181507, 31.853928, 1000],
              [117.210678, 31.858777, 1000],
              [117.232448, 31.853065, 1000],
            ],
            model: {
              show: true,
              url: 'http://data.marsgis.cn/gltf/mars/MQ-9-Predator.glb',
              scale: 1,
              minimumPixelSize: 60,
            },
            path: {
              show: true,
              color: '#ffff00',
              opacity: 0.5,
              width: 1,
              isAll: false,
            },
            shadow: [
              {
                show: true,
                type: 'wall',
                color: '#ff0000',
              },
            ],
          },
        ]

        for (var i = 0, len = arrLine.length; i < len; i++) {
          var flydata = arrLine[i]

          flydata.label = {
            show: true,
            font_size: 20,
            pixelOffsetX: 0,
            pixelOffsetY: -20,
            scaleByDistance: true,
            scaleByDistance_far: 80000,
            scaleByDistance_farValue: 0.4,
            distanceDisplayCondition: true,
            distanceDisplayCondition_far: 80000,
          }
          flydata.model = {
            ...flydata.model,
            distanceDisplayCondition: true,
            distanceDisplayCondition_far: 80000,
          }
          flydata.point = {
            show: true,
            color: '#ffff00',
            pixelSize: 8,
            distanceDisplayCondition: true,
            distanceDisplayCondition_near: 80000,
            distanceDisplayCondition_far: 80000000,
          }

          var roamLine = new mars3d.graphic.RoamLine(flydata)
          graphicLayer.addGraphic(roamLine)

          //启动漫游
          roamLine.start()
        }
      }
    </script>
  </body>
</html>
